package com.risk.ctrl.utils;

/**
 * @version: 1.00.00
 * @description: 字符串工具
 * @copyright: Copyright (c) 2022 立林科技 All Rights Reserved
 * @company: 厦门立林科技有限公司
 * @author: hj
 * @date: 2022-07-09 16:32
 */
public class StringBulidUtils {

    /**
     * 字符串替换全部{}里的内容，
     * 该方法处理不了{}里头再嵌套{}，例如："{{}}"
     *
     * @param baseStr
     * @param params
     */
    public static String replaceAllBrace(String baseStr, Object... params) {
        baseStr = baseStr.replaceAll("\\{(.*?)\\}", "%s");
        baseStr = String.format(baseStr, params);
        return baseStr;
    }
}
